Introduction | General Helpline Q&A Directory 

Keep your internet connection alive

Windows persistently asks whether I want to close my internet connection if it is idle for more than a couple of minutes. Can I stop it doing this?

Keeping the 'Disconnect when idle' time low is a good idea as it avoids wasting money on connect charges, but there are times when these pop-up warnings can be annoying. Here's something you can run when needed to keep the connection just busy enough to stop the warnings popping up. Open Notepad and type into it the following code:

Option Explicit
Dim IE
Set IE = WScript.CreateObject("InternetExplorer.Application")
IE.AddressBar = False
IE.StatusBar = False
IE.ToolBar = False
IE.MenuBar = False
IE.Visible = True
IE.Width = 640
IE.Height = 480
Dim timenow
timenow = Now
On Error Resume Next
Refresh
WScript.Quit


Sub Refresh
Do While IE.Visible
IE.Navigate
"http://www.somewebsite.com/"
WScript.Sleep(120000)
Loop
End Sub

Note that Set IE = WScript should be all on one line and that http://www.somewebsite.com/ should be replaced by a real web address of your choice. You can vary the width and height values to fit the page you're displaying.

Save the file as keepalive.vbs and then run it. The script should open an Internet Explorer window and display the web page you chose. It will reload the page every two minutes, keeping the connection open. If Windows doesn't know what to do when you try to run keepalive.vbs you haven't got Windows Scripting installed on your PC. You can download the latest version from http://msdn.microsoft.com/scripting
 © 2002 PC Advisor